package huitugongju;

public class factory {
    public static shape getChart(String chart){
        shape s = null;
        if(chart.equalsIgnoreCase("Circle")){
            s = new circle();
            System.out.println("初始化圆");
        }

        else if(chart.equalsIgnoreCase("Rectangle")){
            s = new rectangle();
            System.out.println("初始化矩形");
        }

        else if(chart.equalsIgnoreCase("Triangle")){
            s = new triangle();
            System.out.println("初始化三角形");
        }
        return s;
    }
}
